<!DOCTYPE html>
<html lang="en">
	<head>
		<meta charset="UTF-8">
		<meta content="width=device-width,initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no" name="viewport">
		<meta http-equiv="X-UA-Compatible" content="ie=edge">
		<title>店铺详情</title>
		<link rel="stylesheet" href="../css/common.css">
		<link rel="stylesheet" href="../css/page.css">
		<script src="../js/jquery-3.2.1.min.js"></script>
		<script src="../js/media.js"></script>
		<script src="../js/common.js"></script>
		<script src="../js/public.js"></script>
		<script type="text/javascript" src="http://api.map.baidu.com/api?v=2.0&ak=G1TP5IX5FqiWtbqPN8sjmCZYhFpwMq0R"></script>
		<style>
			.yhq-ist {
				overflow: hidden;
				width: 96%;
				margin: .2rem 2%;
				height: .7rem;
				background: #fff;
				border-radius: .04rem;
			}
			.bd-0 {
				display: none;
				margin-top: .1rem;
			}
			.bigfont {
				color: #666666;
			}
			.active {
				display: block;
			}
			#container {
				width: 3.75rem;
				height: 1.04rem;
			}
			.amap-logo {
				display: none;
			}
			.amap-copyright {
				bottom: -100px;
				display: none;
			}
			.fls {
				float: left;
				width: 20%;
				height: .7rem;
				text-align: center;
				border-right: 1px dashed #ddd;
			}
			.frs {
				float: left;
				width: 78%;
				text-align: center;
				line-height: .7rem;
				position: relative;
			}
			.Shop .top .right .p2 span {
				padding: 2px 3px;
			}
			.la-spans {
				color: #fff;
				padding: 2px 3px;
				background: #5F3104;
				position: absolute;
				right: .1rem;
				font-size: 12px;
				top: .22rem;
				border-radius: .04rem;
				/* width: 30px; */
				width: 48px;
				line-height: 23px;
			}
			.la-nospans {
				color: #fff;
				padding: 2px 3px;
				background: #dddddd;
				position: absolute;
				right: .1rem;
				font-size: 12px;
				line-height: .2rem;
				top: .25rem;
				border-radius: .04rem;
				width: 30px;
			}
			.smallfont {
				font-size: 12px;
				color: #E73B3B;
			}
			.Shop .top .right .p2 em {
				flex: 0.2;
			}
			.jjp {
				display: none;
			}
			.zhe_zhao {
				width: 1.7rem;
				height: 0.44rem;
				position: absolute;
				bottom: 0.08rem;
				left: 0.08rem;
				background-color: rgba(0, 0, 0, 0.8);
				color: white;
				line-height: 0.44rem;
			}
			.zhe_zhao div {
				height: 0.44rem;
				color: white;
				line-height: 0.44rem;
				margin-left: 0.08rem;
				overflow: hidden;
			}
			#beijing {
				width: 100%;
				height: 1.6rem;
				display: block;
				margin: 0 auto
			}
			#btbeijing {
				width: 0.3rem;
				height: 0.3rem;
			}
			#tupianbt {
				width: 0.3rem;
				height: 0.3rem;
				position: absolute;
				top: 0.08rem;
				left: 0.08rem;
			}
			.bd-1 {
				padding-top: 0px;
			}
			.Shop .select-button div {
				height: auto;
			}
			.Shop .select-button {
				padding: .02rem 0;
			}
			.Shop .select-button div:last-child img {
				margin-right: 0;
			}
			#alljingpai {
				margin-bottom: 40px;
			}
			.sssa {
				background: #fff;
				padding: 0 2px;
				color: #fa4535;
			}
			.Shop .bd-1 ul li>div div,
			.Shop .bd-2 ul li>div div {
				line-height: .2rem;
				text-align: center;
			}
			.shop_tips {
				height: 100%;
				padding: .08rem .2rem;
			}
			.overflowhideen {
				display: block;
				white-space: nowrap;
				overflow: hidden;
				text-overflow: ellipsis;
				height: 0.12rem;
			}
			#allmap {
				position: relative;
			}
			#allmap2 {
				position: absolute;
				width: 100%;
				height: 260px;
				z-index: 10000;
			}
			#overlay {
	            background: #000;
	            filter: alpha(opacity=50); /* IE的透明度 */
	            opacity: 0.5; /* 透明度 */
	            display: block;
	            position: absolute;
	            top: 0;
	            left: 0;
	            width: 100%;
	            height: 100%;
	            z-index: 10000001; /* 此处的图层要大于页面 */
	            right: 0;
	            bottom: 0;
	        }
			.box-4 {
				width: 90%;
				/* height: 1.65rem; */
				background: #fff;
				box-sizing: border-box;
				padding: .12rem;
				position: fixed;
				z-index: 10000002;
				top: 20%;
				left: 5%;
				right: 5%;
			}
			.box-4 h5 {
				text-align: center;
				height: 0.24rem;
				line-height: 0.24rem;
				padding: 0.12rem 0;
				font-size: 0.24rem;
			}
			.box-4 li {
				margin-top: 0.12rem;
			}
			.box-4 li p,
			.box-4 li a {
				float: left;
				font-size: 0.16rem;
				line-height: 0.16rem;
			}
			.box-4 li a {
				color: #5F3104;
				text-decoration: underline;
			}
			.add_img11{
				width: 100%;
			}
			#estimate{
				width: 3.19rem;
				margin: 0 auto;
				background: #F7F7F7;
			}
			.estimate_left{
				float: left;
				margin-left: 0.08rem;
				margin-top: 0.08rem;
			}
			.estimate_left img{
				width: 0.32rem;
				height: 0.32rem;
				
			}
			.estimate_left p{
				width: 0.4rem;
				/*height: 0.12rem;*/
				line-height: 0.12rem;
				text-align: left;
				font-size: 0.12rem;
				color: #666;
			}
			.estimate_right{
				float: left;
				width: 2.2rem;
				margin-left: 0.22rem;
				margin-top: 0.08rem;
			}
			.score{
				margin-bottom: 0.13rem;
			}
			.score img{
				float: left;
				width: 0.22rem;
				height: 0.22rem;
				margin-left:0.05rem;
			}
			.user_estimate_center{
				font-size: 0.13rem;
				color: #050001;
			}
			.estimate_time{
				float: right;
				font-size: 0.12rem;
				color: #666;
				margin-right: 0.08rem;
			}
			.estimate_img{
				width: 100%;
				float: left;
				margin: 0.1rem 0;
			}
			.estimate_img img{
				width: 1rem;
				height: 1rem;
			}
		</style>
	</head>
	<body>
		<div id="overlay" v-show="isss" @click='hide()'></div>
		<div class="box-4" v-if="store_info_phone">
			<!--点击头像出来的店铺信息-->
			<h5>紫陶名片</h5>
			<ul>
				<!--<li><img :src="datas.store_image" alt="店铺头像"></li>-->
				<li class="store_name1 clearfix">
					<p>店铺名称:</p>
					<p>{{datas.storeName}}</p>
				</li>
				<li class="store_phone1 clearfix">
					<p>店铺电话:</p>
					<a :href=" 'tel:' + datas.user_Phone ">{{datas.user_Phone}}</a>
				</li>
				<li class="store_weixin1 clearfix" v-if="datas.user_weixin!=''">
					<p>紫陶汇客服:</p>
					<a href="tel:08738882999">0873-8882999</a>
				</li>
			</ul>
		</div>
		<div id="loadingToast" class="weui_loading_toast" style="display:block;">
			<div class="weui_mask_transparent"></div>
			<div class="weui_toast">
				<div class="weui_loading">
					<!-- :) -->
					<div class="weui_loading_leaf weui_loading_leaf_0"></div>
					<div class="weui_loading_leaf weui_loading_leaf_1"></div>
					<div class="weui_loading_leaf weui_loading_leaf_2"></div>
					<div class="weui_loading_leaf weui_loading_leaf_3"></div>
					<div class="weui_loading_leaf weui_loading_leaf_4"></div>
					<div class="weui_loading_leaf weui_loading_leaf_5"></div>
					<div class="weui_loading_leaf weui_loading_leaf_6"></div>
					<div class="weui_loading_leaf weui_loading_leaf_7"></div>
					<div class="weui_loading_leaf weui_loading_leaf_8"></div>
					<div class="weui_loading_leaf weui_loading_leaf_9"></div>
					<div class="weui_loading_leaf weui_loading_leaf_10"></div>
					<div class="weui_loading_leaf weui_loading_leaf_11"></div>
				</div>
				<p class="weui_toast_content">数据加载中...</p>
			</div>
		</div>
		<div id="content" style="visibility: hidden;">
			<!--头部-->
			<div class="public-header flex">
				<!--<span class="public-header-left-search"></span>-->
				<span class="public-header-left-back"></span>
				<span class="public-header-center">{{datas_1.storeName}}</span>
				<span class="public-header-right"></span>
			</div>
			<!--正文-->
			<div class="Shop">
				<div class="top clearfix">
					<img :src="datas_1.storeImage" alt="" @click="show_store_info()">
					<div class="right">
						<p class="p1 flex">
							<span>{{datas_1.storeName}}</span>
							<em>{{datas_1.store_level}}</em>
							<i v-if='datas_1.storeAuthority'></i>
						</p>
						<p class="p2">
							<img v-if='isqiye' style="width: 0.15rem;height:0.15rem;padding: 0.04rem;margin: 0;" id="qy_or_gr" src="../img/qiye.png" />
							<span>{{follow}}</span>
							<!--<em style="margin-left: 0;">{{datas_1.storeScore}}分</em>-->
							<i>{{datas_1.storeAmountGuaranteed}}元</i>
							<span id="pay_to_merchant" @click="pay_to_merchant" style="margin-left: 0.3rem;">向商家付款</span>
						</p>
					</div>
				</div>
				<div class="hd flex">
					<a href="javascript:;" class="active">店铺首页</a>
					<a href="javascript:;">店铺商品</a>
					<a href="javascript:;">即将结束</a>
					<a href="javascript:;">店铺评价</a>
					<!--<a href="javascript:;">优惠券</a>-->
				</div>
				<div class="bd">
					<div class="bd-1 bd-0 active" style="padding-bottom:0;">
						<img class="add_img11" />
						<p style="padding: 0.12rem;">{{datas_1.store_describe}}</p>
						<p class="title flex">
							<img src="../img/今日拍品@2x.png" alt="">
							<span>今日产品</span>
						</p>
						<ul class="clearfix">
							<div v-if="datas_1.produce.length==0" style="text-align: center;margin: 20px 0;">
								暂无今日产品
							</div>
							<div v-else>
								<li v-for='item in datas_1.produce'>
									<img data-id={{item.produce_id}} onclick="nextUrl(this)" :src="item.produce_head_image.split(',')[0]" alt="" style="width:100%;height: 1.66rem;">
									<p class="p1" style="height: 0.15rem;line-height: 0.15rem;overflow-y: hidden;">{{item.produce_describe}}</p>
									<p class="p2 flex">
										<span>￥:{{item.starting_price}}</span>
										<em>{{item.produce_good_num}}</em>
									</p>
								</li>
							</div>

						</ul>
						<p class="title flex" style='margin-top:.2rem;'>
							<img src="../img/位置详情@2x.png" alt="">
							<span>位置详情</span>
						</p>
						<p class="weizhi" style="padding: 0 0.12rem 0.12rem;font-size: 0.12rem;"></p>
						<div id="allmap2">&nbsp;</div>
						<div id="allmap" style="height: 260px;width: 100%;">

						</div>
					</div>
					
					<div class="bd-3 bd-0">
						<ul id="alljingpai" class="clearfix">
							<li style="position: relative;">
								<img id="beijing" src="../img/配图@3x 2.png" alt="">
								<div id="tupianbt"> <img id="btbeijing" src="../img/表中.png" /></div>
								<p class="tip">
									距离结束：
									<font>2小时32分36秒</font>
								</p>
								<div class="zhe_zhao">
									<div> 我知道你是个好人，但是我不说</div>
								</div>
							</li>
						</ul>
					</div>
					<div class="bd-2 bd-0">
						<ul class="clearfix" id="jingpai">

						</ul>
					</div>
					<div class="bd-4 bd-0">
						<ul id="estimate">
							<li v-for = 'item in estimate' class="clearfix">
								<div class="estimate_left">
									<img class="user_img" :src="item.user_image"/>
									<p class="user_name">{{item.user_nike_Name}}</p>
								</div>
								<div class="estimate_right">
									<div class="clearfix score">
										<img src = "../img/estimate.png" v-for="items in item.score" v-if="items<=item.score"/>
										
									</div>
									<p class="user_estimate_center" v-if='item.content==""'>暂无详细评价</p>
									<p class="user_estimate_center" v-else>{{item.content}}</p>
									
									
								</div>
								<div class="estimate_img">
									<img v-if="item.img1" :src="item.img1"/>
									<img v-if="item.img2" :src="item.img2"/>
									<img v-if="item.img3" :src="item.img3"/>									
								</div>
								<div class="estimate_time">{{returnTime(item.add_date)}}</div>
							</li>
						</ul>
					</div>
					<div class="bd-0" id="yhq">

					</div>
				</div>
				<div style="width: 100%;height: 0.51rem;"></div>
				<div class="select-button flex" style="z-index: 10000000;">
					<div onclick='javascript:window.location.href="../index.html"'>
						<img src="../img/首页@2x.png" alt="">
						<p>首页</p>
					</div>
					<div onclick='javascript:window.location.href="../fenlei/fenlei.html"'>
						<img src="../img/分类 02@2x.png" alt="">
						<p>分类</p>
					</div>
					<div onclick='javascript:window.location.href="../page/Excellent-shop.html"'>
						<img src="../img/发现 02@2x.png" alt="">
						<p>店铺</p>
					</div>
					<div onclick='javascript:window.location.href="../wode/my-page.html"'>
						<img src="../img/我的@2x.png" alt="">
						<p>我的</p>
					</div>
					<!--<div class="flex">
			            <img src="../img/客服@2x.png" alt="">
			            <p>联系客服</p>
			        </div>-->

				</div>
			</div>
		</div>
	</body>

	<script src='../js/vue.js'></script>
	<script src='../js/vue-resource.min.js'></script>
	<script>
		var returnVal = {
			shareTitle: '', //分享的title
			shareLink: '', //分享的链接
			shareImgurl: '', //分享的图片
		}; //分享需要发送的数据
		setTimeout(function() {
			$("#loadingToast").hide();
			$("#content").css('visibility', 'visible');
			$('body').css('min-height', 'inherit');
			$('#overlay').css('height',$('body').height());
		}, 1000)

		$('.hd a').click(function() {
			var index = $(this).index();
			$(this).addClass('active').siblings().removeClass('active');
			$('.bd-0').eq(index).addClass('active').siblings().removeClass('active');
			if(index == 3) {
				//yhqList(); //加载优惠券
			}
		})
		function returnTime(res) {
            var now = new Date(res);
            var year = now.getFullYear();
            var month = now.getMonth() + 1;
            var date = now.getDate();
            var hour = now.getHours();
            var minute = now.getMinutes();
            var second = now.getSeconds();
            return year + "-" + month + "-" + date + " " + hour + ":" + minute;
        }
		var s_name = getQueryString('s_name');
		//$('title').text(s_name+"的店铺");
		$(function() {
			//getStore();
			jPshop();
			alljPshop();

			function getUrlParam(name) {
				var reg = new RegExp('(^|&)' + name + '=([^&]*)(&|$)');
				var r = window.location.search.substr(1).match(reg);
				if(r != null) return unescape(r[2]);
				return null; //返回参数值
			}
			var s_id = getUrlParam('s_id');
			new Vue({
				el: 'body',
				data: {
					datas_1: {},
					follow: '',
					all_produce: [], // 全部牌品
					yhqdata: [], //优惠券数据
					isqiye: false,
					storeId: '',
					isss: false,
					store_info_phone: false,
					datas:'',
					estimate:'',//店铺的评价
					estimate_time:[]
				},
				ready: function() {
					var _self = this;
					this.$http.get(base_url + 'ZITAOHUI/store', {
						params: {
							storeId: s_id,
							userId: sessionStorage.getItem("uid")
						}
					}).then(
						function(response) {
							//console.log(response)
							var all_data = response.data.extend.store["0"];
//							all_data = all_data[0];
							var follow = response.data.extend.isguanzhu;
							_self.storeId = all_data.storeId; //这个店铺的id，不是微信登录用户的店铺id
							_self.datas = response.data.extend.store["0"];//
							if(follow == 1) {
								follow = '已关注'
							} else {
								follow = '未关注'
							}
							this.$set('follow', follow);
							this.$set('datas_1', all_data);
							$('title').html(all_data.storeName);
							if(all_data.enterprise_name) { //判断是企业店铺还是个人的店铺
								this.isqiye = true;
							} else {
								this.isqiye = false;
							}
							if(all_data.storeAddress != '' && all_data.storeAddress != null) {
								//alert('biaojiweizhi')
								$('.weizhi').html(all_data.storeAddress);
								allMap(all_data.storeAddress);
								$('#allmap2').click(function() {
									window.location.href = 'http://api.map.baidu.com/geocoder?address=' + all_data.storeAddress + '&output=html&src=yourCompanyName|yourAppName'
								})
							} else {
								$('.weizhi').html('暂未设置店铺位置');
								allMap('天安门');
							}
							returnVal = {
								shareTitle: all_data.storeName, //分享的title
								shareLink: window.location.href, //分享的链接
								shareImgurl: all_data.storeImage, //分享的图片
							}; //分享需要发送的数据
							if(all_data.placard!=undefined&&all_data.placard!=null&&all_data.placard!=''){
								$(".add_img11").attr("src",all_data.placard);
							}
						});
						
						$.ajax({
							type:"get",
							url:base_url + 'ZITAOHUI/getAssessList',
							async:true,
							data:{
								store_id:s_id
							},
							success:function(data){
								console.log(data);
								_self.estimate = data.extend.data;								
							}
						});
				},
				methods: {
					
					pay_to_merchant: function() {
						window.location.href = './payMerchant.html' + "?storeId=" + this.storeId; //跳转到向商家付款页面
					},
					hide:function(){
						this.isss = false;
						this.store_info_phone = false;
					},
					show_store_info:function(){
						this.isss = true;
						this.store_info_phone = true;
					},
					returnTime:function(res){
						var now = new Date(res);
			            var year = now.getFullYear();
			            var month = now.getMonth() + 1;
			            var date = now.getDate();
			            var hour = now.getHours();
			            var minute = now.getMinutes();
			            var second = now.getSeconds();
			            function add0(num){
			            	if(Number(num)<10){
			            		return num = "0"+num;
			            	}else{
			            		return num;
			            	}
			            	
			            }
			            return year + "-" + add0(month) + "-" + add0(date) + " " + add0(hour) + ":" + add0(minute);
					}
				}
			})

		});

		function yhqList() {
			//获取优惠券列表
			var s_id = GetQueryString("s_id");
			$.ajax({
				url: base_url + 'ZITAOHUI/store/coupon',
				type: "post",
				data: {
					storeId: s_id
				},
				success: function(data) {
					if(data.code == 1) {
						$("#yhq").html("");
						if(data.extend.data.length == 0) {
							$("#yhq").html('<div style="text-align: center;margin-top: 20px;">' + "暂无优惠券" + '</div>')
						} else {
							$.each(data.extend.data, function(k, v) {
								$("#yhq").append(' <div class="yhq-ist">' +
									'                <div class="fls">' +
									'                    <img src="../img/优惠券@2x.png" style="width: .37rem;margin-top: .2rem">' +
									'                </div>' +
									'                <div class="frs">' +
									'                    <span><span class="smallfont"></span><span class="bigfont">' + "满" + v.useCondition + "减" + v.couponMoney + '</span></span>' +
									'                    <span class="la-spans" data-id="' + v.couponId + '" onclick="getCoupon(this)">领取</span>' +
									'                </div>' +
									'            </div>')
							})
						}

					}
				}
			})
		}

		function jPshop() {
			//获取节拍
			var sid = GetQueryString("s_id");
			var parms = "?storeId=" + sid;
			$.ajax({
				url: base_url + 'ZITAOHUI/findleastAu' + parms,
				dataType: "json",
				success: function(data) {
					if(data.code == 1) {
						var _d = data.extend.list;
						$("#jingpai").html("");
						$.each(_d, function(k, v) {
							$("#jingpai").append('<li data-id="' + v.produce_id + '" onclick="nextUrl(this)">' +
								'<div>' +
								'<img src=' + v.produce_head_image.split(',')[0] + '>' +
								'<div>' +
								//'<span class="jjp" style="width: 100%;text-align: center;">' + getTime(v.surplusTime, k) + '</span>' +
								'<p class="jjp" style="display: block;">' + getTime(v.surplusTime, k) + '</p>' +
								' </div>' +
								' </div>' +
								'<p class="p1 overflowhideen">' + v.produce_describe + '</p>' +
								'<p class="p2 flex">' +
								'<span>' + "￥:" + v.starting_price + '</span>' +
								'<em>' + v.produce_good_num + '</em>' +
								'</p>' +
								'</li>')
						})
					} else {
						alert("网络请求超时");
					}
				}
			})
		}

		function alljPshop() {
			//获取全部竞拍
			var sid = GetQueryString("s_id");
			var parms = "?storeId=" + sid;
			$.ajax({
				url: base_url + 'ZITAOHUI/findAllAu' + parms,
				dataType: "json",
				success: function(data) {
					if(data.code == 1) {
						var _d = data.extend.list;
						$("#alljingpai").html("");

						$.each(_d, function(k, v) {
							//console.log("时间="+v.surplusTime);
							$("#alljingpai").append('<li data-id="' + v.produce_id + '" onclick="nextUrl(this)"  style="position: relative;">' +
								'<img id="beijing" src=' + v.produce_head_image.split(',')[0] + ' alt="">' +
								//                                                      '<div id="tupianbt">'+ '<img id="btbeijing"  /></div>'+
								'<p class="tip">' +
								"距离结束：" +
								'<span class="jjps" >' + getTimes(v.surplusTime, k) + '</span>' +
								'</p>' +
								'<div class="zhe_zhao">' +
								'<div>' + v.produce_describe + '</div>' +
								'</div>' +
								'</li>')

						})

						//                  $.each(_d,function(k,v){
						//                      $("#alljingpai").append( '<li style="height: auto;">'+
						//                          '<div>'+
						//                          '<img src='+v.produce_head_image+' alt="">'+
						//                          '<div class="flex time">'+
						//                          '<span class="jjp" style="width: 100%;">'+ getTime(v.surplusTime,k)+'</span>'+
						//                          ' </div>'+
						//                          ' </div>'+
						//                          '<p class="p1">'+v.produce_describe+'</p>'+
						//                          '<p class="p2 flex">'+
						//                          '<span style="margin-right: 10px;">'+"￥"+v.starting_price+'</span>'+
						//                          '<em>'+"数量："+v.produce_good_num+'</em>'+
						//                          '</p>'+
						//                          '</li>')
						//                  })
					} else {
						alert("网络请求超时");
					}

				}

			})
		}

		function getDianPu() {
			/***获取店铺***/
			$.ajax({
				url: base_url + "ZITAOHUI/auctionProduce",
				type: "post",
				data: {

				}
			})
		}

		function nextUrl(obj) {
			window.location.href = "buy-info-page.3.html?p_id=" + $(obj).attr("data-id") + "&time=" + new Date().getTime();
		}

		function getCoupon(obj) {
			//领取优惠券
			var _id = $(obj).attr("data-id");
			var params = "?uid=" + sessionStorage.getItem("uid") + "&couid=" + _id;
			$.ajax({
				url: base_url + "ZITAOHUI/coupon/getCoupon" + params,
				dataType: "json",
				success: function(data) {
					//console.log(data);
					if(data.extend.date == 0) {
						alert("领取成功");
					} else if(data.extend.date == 2) {
						alert("您已领取过");
					}
				}
			})
		}

		function getTime(mss, index) {
			if(mss != undefined && mss != null && mss != '') {
				setInterval(function() {
					mss--;
					//console.log(mss);
					if(mss == 0 || mss < 0 || mss == NaN || mss == 'NaN' || typeof mss == NaN || typeof mss == 'NaN' || mss == null || mss == 'null' || mss == undefined) {
						$(".jjp").eq(index).text("已结束");
					} else {
						var days = Math.floor(mss / 1440 / 60);
						var hours = Math.floor((mss - days * 1440 * 60) / 3600);
						var minutes = Math.floor((mss - days * 1440 * 60 - hours * 3600) / 60);
						var seconds = (mss - days * 1440 * 60 - hours * 3600 - minutes * 60);
						var sss = parseInt(days * 24 + hours);
						//						$(".jjp").eq(index).html('<img src="../img/提醒@2x.png" style="display: inline-block;width: 12px;height: 12px;" alt=""><a style="color: #fff;">'+'距结束:'+'</a><a class="sssa">'+hours+'</a>' + ":" + '<a class="sssa">' + minutes+'</a>' +":"+ '<a class="sssa">' + seconds + '</a>');
						$(".jjp").eq(index).html('<a style="color: #fff;">' + '距结束:' + '</a><a class="sssa">' + sss + '</a>' + ":" + '<a class="sssa">' + minutes + '</a>' + ":" + '<a class="sssa">' + seconds + '</a>');
					}
				}, 1000);
			} else {
				$(".jjp").eq(index).text("已结束");
			}
		}

		function getTimes(mss, index) {
			if(mss != undefined && mss != null && mss != '') {
				setInterval(function() {
					mss--;
					//console.log(mss);
					if(mss == 0 || typeof mss == NaN || typeof mss == 'NaN') {
						return "已结束";
					} else {
						var days = Math.floor(mss / 1440 / 60);
						var hours = Math.floor((mss - days * 1440 * 60) / 3600);
						var minutes = Math.floor((mss - days * 1440 * 60 - hours * 3600) / 60);
						var seconds = (mss - days * 1440 * 60 - hours * 3600 - minutes * 60);
						var str = "距截拍" + days + "天" + hours + "小时" + minutes + "分钟" + seconds + "秒";
						//console.log(str);
						$(".jjps").eq(index).text(str);
					}
				}, 1000);
			} else {
				return "已结束";
			}
		}
		//        if(mss == 0){
		//            $(".jjp").eq(index).text("已结束");
		//        }else{
		//            var days = Math.floor(mss / 1440 / 60);
		//            var hours = Math.floor((mss - days * 1440 * 60) / 3600);
		//            var minutes = Math.floor((mss - days * 1440 * 60 - hours * 3600) / 60);
		//            var seconds = (mss - days * 1440 * 60 - hours * 3600 - minutes *60);
		//            $(".jjp").eq(index).text("距截拍"+hours + "小时" + minutes + "分钟"+seconds+"秒");
		//        }
		//        $(".jjp").show();
		//        }
		function checkTime(i) {
			if(i < 10) {
				i = "0" + i;
			}
			return i;
		}

		function allMap(str) {
			// 百度地图API功能
			var map = new BMap.Map("allmap");
			var point = new BMap.Point(116.331398, 39.897445);
			map.centerAndZoom(point, 16);
			// 创建地址解析器实例
			var myGeo = new BMap.Geocoder();
			// 将地址解析结果显示在地图上,并调整地图视野
			myGeo.getPoint(str, function(point) {
				if(point) {
					map.centerAndZoom(point, 16);
					map.addOverlay(new BMap.Marker(point));
				} else {
					alert("您的店铺位置暂时没办法显示!");
				}
			}, "全国");
		}
	</script>

</html>